<?php
class UserVoiceWidget  extends CWidget{
    
	//输出字符串
	private $userVoice = '';
    
    private $controller= '';
    
    private $action= '';

	public function init(){
        $this->controller = Yii::app()->controller->id;  
        $this->action = Yii::app()->controller->action->id; 
	}

	public function run(){
        $this->userVoice();
		echo $this->userVoice;
	}

    public function userVoice(){
        $this->userVoice = <<<UserVoice
                <!-- UserVoice JavaScript SDK (only needed once on a page) -->
                <script>(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/v9NkbUJVKcR9n0RExGMQ.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})()</script>

                <!-- A tab to launch the Classic Widget -->
                <script>
                UserVoice = window.UserVoice || [];
                UserVoice.push(['showTab', 'classic_widget', {
                  mode: 'full',
                  primary_color: '#34495e',
                  link_color: '#1abc9c',
                  default_mode: 'support',
                  forum_id: 214757,
                  tab_label: '反馈和支持',
                  tab_color: '#1abc9c',
                  tab_position: 'middle-left',
                  tab_inverted: false
                }]);
                </script>
UserVoice;
    }
}


